#include "application.h"

Application* Application::m_instance = 0;

Application* Application::instance()
{
    return Application::m_instance;
}

Application::Application(int argc, char *argv[]) : Object()
{
    if ( m_instance != 0)
    {
        throw std::exception();
    }

    argc = 0;
    argv = 0;
    m_instance = this;
}

Application::~Application()
{}

int Application::exec()
{
    return _eventLoop.exec();
}

void Application::quit()
{
    _eventLoop.quit();
}

const EventLoop& Application::eventLoop() const
{
    return _eventLoop;
}

EventLoop& Application::eventLoop()
{
    return _eventLoop;
}
